package com.apphome.rbac.domain;

import java.sql.Timestamp;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import com.apphome.dal.AbstractEntity;



/**
 * The persistent class for the t_roles database table.
 * 
 */
@Entity
@Table(name="t_roles")
public class Role extends AbstractEntity {
	private static final long serialVersionUID = 1L;
	@Column(name="ROLE_ID")
	private String id;
	private Timestamp createTime;
	private Object enabled;
	private Timestamp lastupdateTime;
	private String roleDesc;
	private String roleName;
	private List<RoleAuthority> rolesAuthorities;
	private UsersRole usersRole;

	public Role() {
	}


	@Column(name="CREATE_TIME")
	public Timestamp getCreateTime() {
		return this.createTime;
	}

	public void setCreateTime(Timestamp createTime) {
		this.createTime = createTime;
	}


	public Object getEnabled() {
		return this.enabled;
	}

	public void setEnabled(Object enabled) {
		this.enabled = enabled;
	}


	@Column(name="LASTUPDATE_TIME")
	public Timestamp getLastupdateTime() {
		return this.lastupdateTime;
	}

	public void setLastupdateTime(Timestamp lastupdateTime) {
		this.lastupdateTime = lastupdateTime;
	}


	@Column(name="ROLE_DESC")
	public String getRoleDesc() {
		return this.roleDesc;
	}

	public void setRoleDesc(String roleDesc) {
		this.roleDesc = roleDesc;
	}


	@Column(name="ROLE_NAME")
	public String getRoleName() {
		return this.roleName;
	}

	public void setRoleName(String roleName) {
		this.roleName = roleName;
	}


	//bi-directional many-to-one association to RolesAuthority
	@OneToMany(mappedBy="role")
	public List<RoleAuthority> getRolesAuthorities() {
		return this.rolesAuthorities;
	}

	public void setRolesAuthorities(List<RoleAuthority> rolesAuthorities) {
		this.rolesAuthorities = rolesAuthorities;
	}


	//bi-directional many-to-one association to UsersRole
	@ManyToOne
	@JoinColumn(name="ROLE_ID", referencedColumnName="ROLE_ID")
	public UsersRole getUsersRole() {
		return this.usersRole;
	}

	public void setUsersRole(UsersRole usersRole) {
		this.usersRole = usersRole;
	}

}